<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<div>
    <input type="button" id="99" value="显示九九乘法表" onclick="dis()"/>
</div>
<script type="text/javascript">
    let i = 1, j = 1;

    function dis() {
        i == 1 && document.write("<table>");
        j == 1 && document.write("<tr id='t9'>");
        document.write("<td style='width: 70px; border: 1px black solid'>" + i + "*" + j + "=" + i * j + "</td>");
        if (j == i) {
            document.write("</tr>");
            i++;
            j = 1;
        } else {
            j++;
        }
        if (i == 10) {
            document.write("</table>");
            // var obj = document.getElementById("t9");
            // obj.style.background = "red";
            document.write("<style>td{background:red;}</style>");
            return 0;
        }
        setTimeout(dis, 500);
    }
</script>
</body>
</html>
